package cn.tedu.dictionary.service.handler;

import cn.tedu.dictionary.pojo.entity.SysDictType;
import com.alibaba.otter.canal.protocol.CanalEntry;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.stereotype.Component;
import top.javatool.canal.client.annotation.CanalTable;
import top.javatool.canal.client.handler.EntryHandler;

@CanalTable("sys_dict_type")
@Component
public class SysDictTypeHandler implements EntryHandler<SysDictType> {
    @Autowired
    private RedisTemplate redisTemplate;
    @Override
    public void insert(SysDictType sysDictType) {
        System.out.println("insert:"+sysDictType);
        redisTemplate.opsForValue().set("dict:"+sysDictType.getDictId(),sysDictType);
    }

    //.....
}
